// Copyright 2009 sbva project
//
// This file is part of sbva,
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.googlecode.sbva.example.businessobjects;

import com.googlecode.sbva.example.businessobjects.validator.ValidSsn;
import java.io.Serializable;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 */
public class Person implements Serializable {

   @NotNull(message="struts://error.input.required/?0=create.user.name.first")
   @Size(min=1, message="struts://error.size.invalid/?0=create.user.name.first&1={min}&2={max}")
   private String firstName;
   @NotNull(message="struts://error.input.required/?0=create.user.name.last")
   @Size(min=1, message="struts://error.size.invalid/?0=create.user.name.last&1={min}&2={max}")
   private String lastName;
   private String middleName;
   @NotNull(message="struts://error.input.required/?0=create.user.ssn")
   @ValidSsn
   private SocialSecurityNumber ssn;
   @NotNull(message="struts://error.input.required/?0=create.user.address.address")
   @Valid
   private Address address;

   public Address getAddress() {
      return address;
   }

   public void setAddress(Address address) {
      this.address = address;
   }

   public String getFirstName() {
      return firstName;
   }

   public void setFirstName(String firstName) {
      this.firstName = firstName;
   }

   public String getLastName() {
      return lastName;
   }

   public void setLastName(String lastName) {
      this.lastName = lastName;
   }

   public String getMiddleName() {
      return middleName;
   }

   public void setMiddleName(String middleName) {
      this.middleName = middleName;
   }

   public SocialSecurityNumber getSsn() {
      return ssn;
   }

   public void setSsn(SocialSecurityNumber ssn) {
      this.ssn = ssn;
   }
}
